feat(export-package): enforce complete game asset packages - #97
feat(export-package): enforce complete game asset packages#97xyh202131 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| return safeSegment(id, 'id').slice(-8) || 'id' | ||
| } | ||
|
|
||
| function packageRoot(model: ExportPackageModel): string { |
There was a problem hiding this comment.
High: this root omits outfitId/outfitName, even though the app routes exports by characterId and outfitId. Two outfits for the same character will generate the same ZIP name and internal folder root, so one export can overwrite or mask another on disk. Include the outfit identifier in the package root or filename.
| const reason = error instanceof Error ? error.message : '未知错误' | ||
| throw new Error(`${field}: 图片读取失败(${reason})`) | ||
| } | ||
| if (blob.type.toLowerCase() !== 'image/png') throw new Error(`${field}: 文件类型必须是 image/png`) |
There was a problem hiding this comment.
Medium: this hard MIME check rejects valid PNG bytes whenever the response Blob has an empty or generic type (common when the server omits Content-Type). The code already validates the PNG signature and alpha channel from the bytes, so this extra gate can fail legitimate exports unnecessarily.
与 #119 一起合并时构建失败:缺
|
8eb985f to
e8a891e
Compare
本次更新
gifenc依赖,避免引入未确认的交付格式。验证